/*
 * (c) Copyright 2014 Hewlett-Packard Development Company, L.P. All rights reserved.
 */
package com.hp.snap.gr.db.voltdb;

/**
 * @author Yang, Lin
 * @since 3.2
 */
public class VoltDBClientConfig {
    private String url;

    /**
     * authentication user
     */
    private String user;

    /**
     * authentication password as plain text
     */
    private String password;

    /**
     * authentication password as a SHA-1 encoded string (The hashed password must be a 40-byte hex-encoding of the
     * 20-byte SHA-1 hash.)
     */
    private String hashedpassword;

    /**
     * Whether the request is submitted on the standard client port (the default) or the admin port (when you specify
     * admin=true). If the database is in admin mode, you must submit requests over the admin port or else the request
     * is rejected by the server.
     * <p/>
     * The admin port should be used for administrative tasks only. Although all stored procedures can be invoked
     * through the admin port, using the admin port through JSON is far less efficient than using the client port. All
     * admin mode requests to JSON are separate synchronous requests; whereas calls to the normal client port are
     * asynchronous through a shared session.
     */
    private Boolean admin;

    /**
     * The jsonp argument is provided as a convenience for browser-based applications (such as Javascript) where
     * cross-domain browsing is disabled. When you include the jsonp argument, the entire response is wrapped as a
     * function call using the function name you specify. Using this technique, the response is a complete and valid
     * Javascript statement and can be executed to create the appropriate language-specific object.
     */
    private String jsonp;

    public VoltDBClientConfig(String url) {
        this.url = url;
    }

    public VoltDBClientConfig(String url, String user, String password) {
        this.url = url;
        this.user = user;
        this.password = password;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getHashedpassword() {
        return hashedpassword;
    }

    public void setHashedpassword(String hashedpassword) {
        this.hashedpassword = hashedpassword;
    }

    public Boolean getAdmin() {
        return admin;
    }

    public void setAdmin(Boolean admin) {
        this.admin = admin;
    }

    public String getJsonp() {
        return jsonp;
    }

    public void setJsonp(String jsonp) {
        this.jsonp = jsonp;
    }
}
